<template>
	<view class="block-img" @click="goPage(data)">
		<image :src="data.img" mode="aspectFill"></image>
	</view>
</template>

<script>
	export default{
		name:"BlockImg",
		props:{
			data:{
				type:Object,
				default(){
					return {}
				}
			}
		},
		methods:{
			goPage(data){
				if(data.type===1){
					uni.navigateTo({
						url:data.href
					})
				}
				if(data.type===2){
					uni.navigateTo({
						url:"/pages/link/link?url="+data.href
					})
				}
			}
		}
	}
</script>

<style scoped lang="less" src="./BlockImg.less"></style>
